
<style>
table.nav_tag_list {margin-bottom: 0.2rem;}
table.nav_tag_list td {padding: 0.3rem;}
table.nav_tag_list td a{margin-right: 0.5rem;}
.nav_tag_list .active {font-weight: 800;}
</style>

		<table class="small nav_tag_list">
		<?php if(!empty($forum['tagcatelist'])) {foreach($forum['tagcatelist'] as $i=>$tagcate) { ?>
			<tr>
				<td class="text-muted text-nowrap" align="right" valign="top">
					<?php echo $tagcate['name'];?>：
				</td>
				<td>
					<?php
						$tagidadd = '';
						$tagactive = '';
						switch ($i) {
							case 0: $tagidadd = "0_{$tagid2}_{$tagid3}_{$tagid4}";
								$tagactive = 0 == $tagid1 ? ' class="active"' : '';
								break;
							case 1: $tagidadd = "{$tagid1}_0_{$tagid3}_{$tagid4}";
								$tagactive = 0 == $tagid2 ? ' class="active"' : '';
								break;
							case 2: $tagidadd = "{$tagid1}_{$tagid2}_0_{$tagid4}";
								$tagactive = 0 == $tagid3 ? ' class="active"' : '';
								break;
							case 3: $tagidadd = "{$tagid1}_{$tagid2}_{$tagid3}_0";
								$tagactive = 0 == $tagid4 ? ' class="active"' : '';
								break;
						}
					?>
					<a href="<?php echo url("forum-$fid-1", array('tagids'=>$tagidadd));?>" <?php echo $tagactive;?>><?php echo lang('all');?></a>
					<?php foreach($tagcate['taglist'] as $tag) { ?>
					<?php 
						switch ($i) {
							case 0: 
								$tagidadd = "{$tag['tagid']}_{$tagid2}_{$tagid3}_{$tagid4}";
								$tagactive = $tag['tagid'] == $tagid1 ? ' class="active"' : '';
								break;
							case 1: $tagidadd = "{$tagid1}_{$tag['tagid']}_{$tagid3}_{$tagid4}";
								$tagactive = $tag['tagid'] == $tagid2 ? ' class="active"' : '';
								break;
							case 2: $tagidadd = "{$tagid1}_{$tagid2}_{$tag['tagid']}_{$tagid4}";
								$tagactive = $tag['tagid'] == $tagid3 ? ' class="active"' : '';
								break;
							case 3: $tagidadd = "{$tagid1}_{$tagid2}_{$tagid3}_{$tag['tagid']}";
								$tagactive = $tag['tagid'] == $tagid4 ? ' class="active"' : '';
								break;
						}
					?>
					<a href="<?php echo url("forum-$fid-1", array('tagids'=>$tagidadd));?>" <?php echo $tagactive;?>><?php echo $tag['name'];?></a>
					<?php } ?>
				</td>
			</tr>
		<?php }} ?>
		</table>
		